{include file='head'/}
<div class="layui-tab pear-notice" style="margin-top: 0px;left: -200px;">
    <ul class="layui-tab-title">
        <li class="layui-this" id="message">通知</li>
        <li class="" id="notice">消息</li>
    </ul>
    <div class="layui-tab-content" style="height:250px;overflow-x: hidden;">
        <div class="layui-tab-item layui-show">
            {volist name="message" id="vo"}
            <div class="pear-notice-item message_box" notice-form="{$vo.form}" notice-context=""
                 notice-title="{$vo.title}" notice-id="{$vo.id}">
                <img src="{$vo.avatar}">
                <div style="display:inline-block;">{$vo.title}</div>
                <div class="pear-notice-end">{$vo.time}</div>
            </div>
            {/volist}
            <div class="layui-message-footer">
                <a href="javascript:;" class="clear" data-type="message">清空通知</a>
                <span>|</span>
                <a href="javascript:;" class="more">查看更多</a>
            </div>
        </div>
        <div class="layui-tab-item">
            {volist name="notice" id="vo"}
            <div class="pear-notice-item notice_box" notice-form="{$vo.form}" notice-context=""
                 notice-title="{$vo.title}" notice-id="{$vo.id}">
                <img src="{$vo.avatar}">
                <div style="display:inline-block;">{$vo.title}</div>
                <div class="pear-notice-end">{$vo.time}</div>
            </div>
            {/volist}
            <div class="layui-message-footer">
                <a href="javascript:;" class="clear" data-type="notice">清空消息</a>
                <span>|</span>
                <a href="javascript:;" class="more">查看更多</a>
            </div>
        </div>
    </div>
</div>

{include file='footer'/}
<script>
  layui.use(['jquery'], function () {
    var $ = layui.jquery;
    $('.pear-notice .more').click(function () {
      layer.msg('暂未开发哦');
    })
    //清空消息
    $('.pear-notice .clear').click(function () {
      var type = $(this).attr('data-type');
      //parent.layui.$('.layui-badge-dot').css('display', 'none');
      // 删除元素
      $('.' + type + '_box').remove();
      $.post("{:__url('index/message_read')}", {type: type}, function (res) {
        layer.msg('清空成功',{time:1200});
      })
    });

  })
</script>
